﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Webgenscript.aspx.cs" Inherits="Webtest.Webgenscript" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head >
<script type="text/javascript">
    var bidmanager = new Object();
    bidmanager.con = new Array();
    var timer;
    var XmlHttp;

    comodity.trig = function trig() {

        XmlHttp = new XMLHttpRequest();

        var url = "ResponsePage.aspx?id=" + comodity.id;
        XmlHttp.onreadystatechange = comodity.SetValue();
        XmlHttp.open("GET", url, true);
        XmlHttp.send(null);






    }



    comodity.SetValue = function setv() {

        var info = document.getElementById(comodity.bannerid)

        if (XmlHttp.readyState == 4) {
            if (XmlHttp.status == 200)//获得到了数据
            {
                var text = XmlHttp.responseText;

                document.getElementById(comodity.bannerid).innerText = text;




            }

        }


    }
    
    
    
    
    
    
    
    
    bidmanager.add = function add(id, bannerid) {

        var comodity = new Object()
        comodity.id = id;
        comodity.bannerid = bannerid;
        bidmanager.con.push(comodity)


    }
    bidmanager.trig = function trig() {

        var d = new Date();
        for (var i = 0; i < bidmanager.con.length; i++)
            bidmanager.con[i].trig();


    }


    function init() {


        bidmanager.add(1, "banner");

        timer = setInterval("bidmanager.trig()", 1000);





    }

    window.onload = function() {

        init();



    }
  

 
 






</script>    
    
    
    
    
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <span id="banner"></span>
    </div>
    </form>
</body>
</html>
